package com.example.queue;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Title: spring-boot-druid
 * @Package com.example.queue
 * @Date 2018/5/8上午11:42
 * @Author PX ye
 * @E-mail yepx2013@gmail.com
 * @Company http://www.yiautos.com
 * @Description: ${todo}
 */
public class TestQueue extends BlockingConsumer {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Override
    protected void processMessage(Object message) {

        String messageStr = (String) message;
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);
        System.out.println(messageStr);

    }

    /**
     * Offer.
     *
     * @param LocalDirectoryQueue
     *            the sms queue info
     * @return true, if successful
     */
    public static boolean offer(Object message) {
        boolean b = QueuesHolder.getQueue(TestQueue.class.getName()).offer(message);
        System.out.println("添加推送的列队:" + b);
        return b;
    }

    @Override
    protected void clean() {

    }

}
